package com.link2room.optimus.service;

import com.link2room.common.jpa.result.QueryResult;
import com.link2room.optimus.dto.param.api.MarketingQueryApiParamDto;
import com.link2room.optimus.entity.*;
import com.link2room.optimus.mapper.HotelMinPriceMapper;
import com.link2room.optimus.mapper.MarketingMapper;
import com.link2room.optimus.mapper.PriceStaticMapper;
import com.link2room.soundwave.dto.result.base.PmsRmtypeAvailDto;

import java.util.List;

/**
 * Created by sss on 2016/9/1.
 */
public interface IMarketingService {

    /**
     * 保存集团级信息
     * @throws Exception
     */
    void saveMarketingGroupBase(MarketingCampaigns marketingCampaigns,
                                List<MarketingCampaignsWeek> marketingCampaignsWeeks,
                                List<MarketingCampaignsNorsv> marketingCampaignsNorsvs,
                                List<MarketingCampaignsExdate> marketingCampaignsExdates) throws Exception;

    void updateMarketingGroupBase(MarketingCampaigns marketingCampaigns,
                                  List<MarketingCampaignsWeek> marketingCampaignsWeeks,
                                  List<MarketingCampaignsNorsv> marketingCampaignsNorsvs,
                                  List<MarketingCampaignsExdate> marketingCampaignsExdates) throws Exception;

    void saveOrUpdateMarketingPbChannels(List<MarketingCampaignsChannel> marketingCampaignsChannels,
                                         List<MarketingCampaignsPrice> marketingCampaignsPrices) throws Exception;

    /**
     * 查询满足条件活动列表
     * @param marketingQueryApiParamDto
     * @return
     * @throws Exception
     */
    QueryResult<MarketingMapper> getMarketingList(MarketingQueryApiParamDto marketingQueryApiParamDto)throws Exception;

    /**
     * 查询房型基础卖价
     * @param lhotelGroupCode
     * @param lhotelCode
     * @param rmtype
     * @param checkInDate
     * @param checkOutDate
     * @return
     * @throws Exception
     */
    QueryResult<PriceStaticMapper> getRmtypeStaticPrice(String lhotelGroupCode, String lhotelCode, String priceCode,
                                                        String rmtype, String checkInDate, String checkOutDate)throws Exception;

    /**
     * 查询酒店最低价
     * @param lhotelGroupCode
     * @param lhotelCode
     * @param checkInDate
     * @param checkOutDate
     * @param pbChannel
     * @return
     * @throws Exception
     */
    QueryResult<HotelMinPriceMapper> getHotelMinPrice(String lhotelGroupCode, String lhotelCode,
                                                      String checkInDate, String checkOutDate, String pbChannel)throws Exception;

    Integer getMinSaleNum(String useRealAvail,
                          String useSetNum,
                          Integer minSaleNum,
                          Integer setNum,
                          MarketingCampaignsStock mcs,
                          MarketingCampaignsStockSold mcsd,
                          PmsRmtypeAvailDto roomAvail)throws Exception;

    Integer getSaleNum(String useRealAvail,
                       String useSetNum,
                       Integer setNum,
                       MarketingCampaignsStock mcs,
                       MarketingCampaignsStockSold mcsd,
                       PmsRmtypeAvailDto roomAvail)throws Exception;

}
